package com.cloudcreativity.blyg.ui.setting;

import android.app.Activity;

import com.cloudcreativity.blyg.base.BaseApp;
import com.cloudcreativity.blyg.base.BaseDialogImpl;
import com.cloudcreativity.blyg.base.BaseModel;
import com.cloudcreativity.blyg.base.CommonWebActivity;
import com.cloudcreativity.blyg.databinding.ActivitySettingBinding;
import com.cloudcreativity.blyg.utils.APIService;
import com.cloudcreativity.blyg.utils.CacheUtils;
import com.cloudcreativity.blyg.utils.ChangePwdUtils;
import com.cloudcreativity.blyg.utils.ToastUtils;
import com.cloudcreativity.blyg.utils.UpdateManager;

public class SettingModel extends BaseModel<Activity, ActivitySettingBinding> {

    SettingModel(Activity context, ActivitySettingBinding binding, BaseDialogImpl baseDialog) {
        super(context, binding, baseDialog);
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initData() {

    }

    public void onBack(){
        context.finish();
    }

    public void onUpdate(){
        UpdateManager.checkVersion(context,getBaseDialog());
    }

    public void onClear(){
        CacheUtils.clearCache(BaseApp.app);
        ToastUtils.showShortToast(context,"已清除");
    }

    public void onChange(){
        new ChangePwdUtils(context,getBaseDialog()).show();
    }

    public void onSync(){

    }

    public void onHelp(){
        CommonWebActivity.startActivity(context,"用户使用帮助",
                APIService.HOST_APP+"/base/systemUseShow");
    }
}
